<?php
import("@.DAO.BaseDAO");

class UserDAO extends BaseDAO
{
    protected static $instance = null;

    protected function __construct()
    {
    }

    private function __clone()
    {
    }


    public function createUser($user)
    {
        return $user->add();
    }

    public function updateUser($user)
    {
        return $user->save();
    }

    public function getUserById($id)
    {
        return (new UserModel())->find($id);
    }

    public function getUserByTel($tel)
    {
        return (new UserModel())->where('tel=' . $tel)->find();
    }

    public function getUserByAcctNo($acctNo)
    {
        return (new UserModel())->where('acct_no=' . $acctNo)->find();
    }

    public function deleteUserById($id)
    {
        return (new UserModel())->delete($id);
    }


}

?>